﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ApptAcceptanceModificationPage.aspx.vb" Inherits="DARSWebservice.ApptAcceptanceModificationPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            font-size: x-large;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="style1">
    
        <strong>Appointment Acceptance Modification</strong></div>
    <br />
    <br />
    AdvisorID: 
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <br />
   Advisor Name:
    <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
    <br />
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" 
        SelectCommand="SELECT [DateTime] FROM [Appointment]"></asp:SqlDataSource>
    Please Select the Appointment DateTime you wish to modify.
    <br />
    Select &quot;Edit&quot; to Modify DateTime and Appointment Status.<br />
    Select &quot;Delete&quot; to delete an appointment.<br />
&nbsp;<br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataKeyNames="AdvisorID,DateTime" DataSourceID="SqlDataSource2" 
        ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowSelectButton="True" HeaderText="Modify/Delete" />
            <asp:BoundField DataField="AdvisorID" HeaderText="AdvisorID" ReadOnly="True" 
                SortExpression="AdvisorID" />
            <asp:BoundField DataField="DateTime" HeaderText="DateTime" 
                SortExpression="DateTime" />
            <asp:BoundField DataField="StudentID" HeaderText="StudentID" 
                SortExpression="StudentID" ReadOnly="True" />
            <asp:BoundField DataField="Reason" HeaderText="Reason" 
                SortExpression="Reason" ReadOnly="True" />
            <asp:BoundField DataField="Status" HeaderText="Status" 
                SortExpression="Status" />
        </Columns>
        <EditRowStyle BackColor="#7C6F57" />
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F8FAFA" />
        <SortedAscendingHeaderStyle BackColor="#246B61" />
        <SortedDescendingCellStyle BackColor="#D4DFE1" />
        <SortedDescendingHeaderStyle BackColor="#15524A" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString6 %>" 
        DeleteCommand="DELETE FROM [Appointment] WHERE [AdvisorID] = ? AND [DateTime] = ? AND (([StudentID] = ?) OR ([StudentID] IS NULL AND ? IS NULL)) AND (([Reason] = ?) OR ([Reason] IS NULL AND ? IS NULL)) AND (([Status] = ?) OR ([Status] IS NULL AND ? IS NULL))" 
        InsertCommand="INSERT INTO [Appointment] ([AdvisorID], [DateTime], [StudentID], [Reason], [Status]) VALUES (?, ?, ?, ?, ?)" 
        OldValuesParameterFormatString="original_{0}" 
        ProviderName="<%$ ConnectionStrings:ConnectionString6.ProviderName %>" 
        SelectCommand="SELECT * FROM [Appointment]" 
        UpdateCommand="UPDATE [Appointment] SET [StudentID] = ?, [Reason] = ?, [Status] = ? WHERE [AdvisorID] = ? AND [DateTime] = ? AND (([StudentID] = ?) OR ([StudentID] IS NULL AND ? IS NULL)) AND (([Reason] = ?) OR ([Reason] IS NULL AND ? IS NULL)) AND (([Status] = ?) OR ([Status] IS NULL AND ? IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_AdvisorID" Type="String" />
            <asp:Parameter Name="original_DateTime" Type="DateTime" />
            <asp:Parameter Name="original_StudentID" Type="String" />
            <asp:Parameter Name="original_StudentID" Type="String" />
            <asp:Parameter Name="original_Reason" Type="String" />
            <asp:Parameter Name="original_Reason" Type="String" />
            <asp:Parameter Name="original_Status" Type="String" />
            <asp:Parameter Name="original_Status" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="AdvisorID" Type="String" />
            <asp:Parameter Name="DateTime" Type="DateTime" />
            <asp:Parameter Name="StudentID" Type="String" />
            <asp:Parameter Name="Reason" Type="String" />
            <asp:Parameter Name="Status" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="StudentID" Type="String" />
            <asp:Parameter Name="Reason" Type="String" />
            <asp:Parameter Name="Status" Type="String" />
            <asp:Parameter Name="original_AdvisorID" Type="String" />
            <asp:Parameter Name="original_DateTime" Type="DateTime" />
            <asp:Parameter Name="original_StudentID" Type="String" />
            <asp:Parameter Name="original_StudentID" Type="String" />
            <asp:Parameter Name="original_Reason" Type="String" />
            <asp:Parameter Name="original_Reason" Type="String" />
            <asp:Parameter Name="original_Status" Type="String" />
            <asp:Parameter Name="original_Status" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />
    </form>
</body>
</html>
